home *** CD-ROM | disk | FTP | other *** search
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!usenet
- From: grantp@usa.pipeline.com(Pete Grant)
- Newsgroups: comp.lang.c++,
- Subject: Re: How do you return values from in-line asm?
- Date: 30 Mar 1996 01:54:38 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4ji48u$oop@news1.h1.usa.pipeline.com>
- References: <4jh71e$iq8@newshost.centrum.is>
- NNTP-Posting-Host: 38.8.120.9
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete Grant)
- X-Newsreader: Pipeline v3.5.0
-
- On Mar 29, 1996 17:35:42 in article <Re: How do you return values from
- in-line asm?>, 'bjarnir@centrum.is (Bjarni Ragnarsson)' wrote:
-
-
- >In article <4j9mab$19si@usenetp1.news.prodigy.com>, XKWR65B@prodigy.com
- (Mark
- >Rubelmann) says:
- >> When I try to use the function in
- >>something like:
- >>
- >> while(Get_Scan_Code==0) {}
- >>
- >>but it doesn't work, it just goes on to the next statement. Any help
- >>would be appreciated.
-
- Bjarni gave an excellent explanation to the assembler coding.
- I hope he doesn't mind my deleting it from this continuation as
- my comment is on a different topic.
-
- Mark's code has another error. Get_Scan_Code
- is a function; therefore, parentheses are necessary:
- while (Get_Scan_Code() == 0) {}.
-
- Unfortunately, the original code is legal syntax and the
- compiler will accept it -- often without so much as a
- warning. The run time result is that the while condition
- is never true and executin falls right through, as Mark
- described.
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-